package com.ruoyi.common.zx;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
@Primary
public class ConstantSmsUtils implements InitializingBean {
    @Value("${tencent.sms.keyId}")
    private String secretID;
    @Value("${tencent.sms.keysecret}")
    private String secretKey;
    @Value("${tencent.sms.sdkAppId}")
    private String smsSdkAppID;
    @Value("${tencent.sms.signName}")
    private String signName;
    @Value("${tencent.sms.regionid}")
    private String regionId;

    public static String SECRET_ID;
    public static String SECRET_KEY;
    public static String SMSSDKAPP_ID;
    public static String SIGN_NAME;
    public static String REGION_ID;

    @Override
    public void afterPropertiesSet() {
        SECRET_ID = secretID;
        SECRET_KEY = secretKey;
        SMSSDKAPP_ID = smsSdkAppID;
        SIGN_NAME = signName;
        REGION_ID = regionId;
    }
}
